<!doctype html>



  


<html class="theme-next pisces use-motion" lang="zh-Hans">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>









<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />















  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />




  
  
  
  

  
    
    
  

  

  

  

  

  
    
    
    <link href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext" rel="stylesheet" type="text/css">
  






<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.1.1" rel="stylesheet" type="text/css" />


  <meta name="keywords" content="Mac," />








  <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico?v=5.1.1" />






<meta name="description" content="Mac环境设置root密码sudo passwd root当安装出现permission denied时候使用sudo *来执行">
<meta name="keywords" content="Mac">
<meta property="og:type" content="article">
<meta property="og:title" content="Mac笔记">
<meta property="og:url" content="https://gitee.com/icmyfuture/icmyfuture/2017/06/16/mac-note/index.html">
<meta property="og:site_name" content="icmyfuture">
<meta property="og:description" content="Mac环境设置root密码sudo passwd root当安装出现permission denied时候使用sudo *来执行">
<meta property="og:locale" content="zh-Hans">
<meta property="og:updated_time" content="2025-06-10T15:32:09.270Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Mac笔记">
<meta name="twitter:description" content="Mac环境设置root密码sudo passwd root当安装出现permission denied时候使用sudo *来执行">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Pisces',
    sidebar: {"position":"left","display":"post","offset":12,"offset_float":0,"b2t":false,"scrollpercent":false},
    fancybox: true,
    motion: true,
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="https://gitee.com/icmyfuture/icmyfuture/2017/06/16/mac-note/"/>





  <title>Mac笔记 | icmyfuture</title>
  














</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail ">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/"  class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">icmyfuture</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle">Nothing is true, everthing is permitted</p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br />
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            归档
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
            
            标签
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/about" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br />
            
            关于
          </a>
        </li>
      

      
        <li class="menu-item menu-item-search">
          
            <a href="javascript:;" class="popup-trigger">
          
            
              <i class="menu-item-icon fa fa-search fa-fw"></i> <br />
            
            搜索
          </a>
        </li>
      
    </ul>
  

  
    <div class="site-search">
      
  <div class="popup">
 <span class="search-icon fa fa-search"></span>
 <input type="text" id="local-search-input" placeholder="search my blog...">
 <div id="local-search-result"></div>
 <span class="popup-btn-close">close</span>
</div>



    </div>
  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal " itemscope itemtype="http://schema.org/Article">
    <link itemprop="mainEntityOfPage" href="https://gitee.com/icmyfuture/icmyfuture/2017/06/16/mac-note/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="iDu">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="/uploads/avatar.jpg">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="icmyfuture">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">Mac笔记</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2017-06-16T16:31:50+08:00">
                2017-06-16
              </time>
            

            

            
          </span>

          
            <span class="post-category" >
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/Technology/" itemprop="url" rel="index">
                    <span itemprop="name">Technology</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
          

          
          

          

          

          

        </div>
      </header>
    

    <div class="post-body" itemprop="articleBody">

      
      

      
        <h1 id="Mac环境"><a href="#Mac环境" class="headerlink" title="Mac环境"></a>Mac环境</h1><h2 id="设置root密码"><a href="#设置root密码" class="headerlink" title="设置root密码"></a>设置root密码</h2><p><code>sudo passwd root</code><br>当安装出现permission denied时候使用<code>sudo *</code>来执行<a id="more"></a></p>
<h2 id="安装brew"><a href="#安装brew" class="headerlink" title="安装brew"></a><a href="https://www.cnblogs.com/51fx/p/7004429.html" target="_blank" rel="noopener">安装brew</a></h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ ruby -e &quot;$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)&quot;</span><br></pre></td></tr></table></figure>
<p><a href="https://thief.one/2017/08/24/1/" target="_blank" rel="noopener">更换为国内源</a><br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">$ brew install redis/zookeeper</span><br><span class="line">$ brew services start redis/zookeeper</span><br><span class="line">$ brew services list</span><br><span class="line">$ brew info redis</span><br></pre></td></tr></table></figure></p>
<p>安装gsed代替mac的sed<code>brew install gnu-sed</code></p>
<h2 id="设置alias"><a href="#设置alias" class="headerlink" title="设置alias"></a>设置alias</h2><p>vim ~/.bashrc （如果没有就创建）<br><code>alias gpull=&#39;git pull origin $1&#39;</code><br>vim ~/.bash_profile （如果没有就创建）<br>加入 <code>source ~/.bashrc</code></p>
<h2 id="安装iTerm2-Alfred-3-Onxy"><a href="#安装iTerm2-Alfred-3-Onxy" class="headerlink" title="安装iTerm2, Alfred 3, Onxy"></a>安装iTerm2, Alfred 3, Onxy</h2><ul>
<li><a href="https://www.jianshu.com/p/d4000cb0e324" target="_blank" rel="noopener">远程ssh连接(iterm2+sshpass+rz+sz)</a><br>远程机器上需要安装lrzsz(<code>yum install -y lrzsz</code>)，同时需要在连接远程ssh的profile上添加iterm trigger</li>
</ul>
<h2 id="VIM"><a href="#VIM" class="headerlink" title="VIM"></a><a href="http://macshuo.com/?tag=vim" target="_blank" rel="noopener">VIM</a></h2><ul>
<li>Mac下默认VIM的位置是/usr/share/vim</li>
<li><a href="http://www.vim.org/sources.php" target="_blank" rel="noopener">安装7.4</a></li>
</ul>
<h2 id="oh-my-zsh"><a href="#oh-my-zsh" class="headerlink" title="oh my zsh"></a>oh my zsh</h2><ul>
<li>查看macos已有的zsh版本：<code>$ zsh --version</code></li>
<li>安装<br><code>curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh</code><br>安装后使用zsh需要手工执行 zsh，如果需要设置为默认的shell，还需要用个命令chsh -s $(which zsh)</li>
<li><a href="http://stackoverflow.com/questions/453236/how-to-set-my-default-shell-on-mac" target="_blank" rel="noopener">Set default shell on Mac</a></li>
<li><a href="http://yijiebuyi.com/blog/b9b5e1ebb719f22475c38c4819ab8151.html" target="_blank" rel="noopener">配置zsh</a></li>
<li><p>zsh插件：<a href="https://github.com/wting/autojump" target="_blank" rel="noopener">autojump</a></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">$ brew install autojump</span><br><span class="line">$ brew info autojump # 查看配置方法</span><br></pre></td></tr></table></figure>
</li>
<li><p><a href="http://blog.richardweitech.cn/2018/07/01/use-zsh/?hmsr=toutiao.io&amp;utm_medium=toutiao.io&amp;utm_source=toutiao.io" target="_blank" rel="noopener">zsh概述+插件</a></p>
</li>
<li>自动更新<br>$ upgrade_oh_my_zsh</li>
</ul>
<h2 id="拷贝音乐至iPod"><a href="#拷贝音乐至iPod" class="headerlink" title="拷贝音乐至iPod"></a>拷贝音乐至iPod</h2><ul>
<li>itunes中，文件-添加到资料库…，然后添加文件夹/文件到资料库</li>
<li>音乐播放列表中，新建播放列表</li>
<li>在资料库-最近添加中，选中需要添加到播放列表的音乐，右键-添加到播放列表</li>
<li>连接iPod至Mac，拖动播放列表到 设备-iPod名称 即可将整个播放列表拷贝至iPod</li>
</ul>
<h2 id="钥匙串访问"><a href="#钥匙串访问" class="headerlink" title="钥匙串访问"></a>钥匙串访问</h2><p>在<code>密码</code>中可更改git等相关密码</p>
<h1 id="iPad软件"><a href="#iPad软件" class="headerlink" title="iPad软件"></a>iPad软件</h1><h2 id="App列表"><a href="#App列表" class="headerlink" title="App列表"></a>App列表</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">爱思助手</span><br><span class="line">APlayer</span><br><span class="line">MarginNote2</span><br><span class="line">围棋cnvcs</span><br></pre></td></tr></table></figure>
<h1 id="Mac软件"><a href="#Mac软件" class="headerlink" title="Mac软件"></a>Mac软件</h1><h2 id="App列表-1"><a href="#App列表-1" class="headerlink" title="App列表"></a>App列表</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br></pre></td><td class="code"><pre><span class="line">百度网盘</span><br><span class="line">钉钉</span><br><span class="line">豆包</span><br><span class="line">搜狗输入法</span><br><span class="line">腾讯QQ/微信/TIM</span><br><span class="line">网易云音乐</span><br><span class="line">网易有道词典</span><br><span class="line">全能解压</span><br><span class="line">Alfred3/uTools/Raycast</span><br><span class="line">Android Studio</span><br><span class="line">Aria2GUI+BaiduExplorer.crx</span><br><span class="line">Arthas</span><br><span class="line">Beyond Compare</span><br><span class="line">Charles</span><br><span class="line">ClashX</span><br><span class="line">CleanMyMac X</span><br><span class="line">CodeRunner2</span><br><span class="line">Cursor</span><br><span class="line">Dash</span><br><span class="line">DataGrip</span><br><span class="line">Dr.Cleaner Pro</span><br><span class="line">Due</span><br><span class="line">FileZilla</span><br><span class="line">Git</span><br><span class="line">Google Chrome</span><br><span class="line">He3</span><br><span class="line">IntelliJ IDEA</span><br><span class="line">iTerm2</span><br><span class="line">Kimi</span><br><span class="line">MAT</span><br><span class="line">MindNode</span><br><span class="line">Mos</span><br><span class="line">MWeb</span><br><span class="line">Navicat Premium Lite</span><br><span class="line">Neat Download Manager</span><br><span class="line">New File Menu</span><br><span class="line">Noizio</span><br><span class="line">Office 2016</span><br><span class="line">Omni Group(Focus/Graffle/Plan/Presence/Outliner)</span><br><span class="line">OpenEmu</span><br><span class="line">Parallels Desktop</span><br><span class="line">Paste</span><br><span class="line">PDF Professional</span><br><span class="line">Pencil</span><br><span class="line">Pixpin</span><br><span class="line">Postman</span><br><span class="line">PyCharm</span><br><span class="line">RapidApi</span><br><span class="line">RDM(Redis Desktop Manager)/Medis</span><br><span class="line">Remote Desktop Manager</span><br><span class="line">Robo 3T</span><br><span class="line">SafeConnect</span><br><span class="line">Shortcat</span><br><span class="line">SizeUp</span><br><span class="line">Sketch</span><br><span class="line">Thor Launcher/Snap/Monico</span><br><span class="line">Transmit</span><br><span class="line">SourceTree</span><br><span class="line">Sublime Text</span><br><span class="line">Tunnelblick</span><br><span class="line">Typora</span><br><span class="line">uPic</span><br><span class="line">V2rayU</span><br><span class="line">Visual Studio Code</span><br><span class="line">WinRAR</span><br><span class="line">Windsurf</span><br><span class="line">Wireshark</span><br><span class="line">WPS Office</span><br><span class="line">XMind</span><br><span class="line">YesPlayMusic</span><br></pre></td></tr></table></figure>
<ul>
<li>mac 中提示应用“已损坏，打不开” 是因为在系统“通用”中没有选择“任何来源”<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo spctl --master-disable/master-enable 显示/隐藏&apos;任何来源&apos;选项</span><br></pre></td></tr></table></figure>
</li>
</ul>
<h2 id="Snap-ThorLauncher-Manual"><a href="#Snap-ThorLauncher-Manual" class="headerlink" title="Snap/ThorLauncher Manual"></a>Snap/ThorLauncher Manual</h2><p>ALT+<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br></pre></td><td class="code"><pre><span class="line">`: AppleMusic/Kimi/TIM</span><br><span class="line">1: Typora/YesPlayMusic/Win-Explorer</span><br><span class="line">2: Trae/Cursor/Windsurf/RapidApi/Win-GitBash</span><br><span class="line">3: Rider/Win-VS2019</span><br><span class="line">4: Another Redis Desktop Manager/RDM/Win-RDCman</span><br><span class="line">5: Wechat</span><br><span class="line">6: </span><br><span class="line">7: 启动台/Neat Download Manager</span><br><span class="line">8: </span><br><span class="line">9: </span><br><span class="line">0: </span><br><span class="line">Q: He3/Dash</span><br><span class="line">W: GoLand/Android Studio</span><br><span class="line">E: Intellij IDEA/Eclipse</span><br><span class="line">R: PyCharm</span><br><span class="line">T: iTerm2</span><br><span class="line">A: DingDing</span><br><span class="line">S: Sublime Text</span><br><span class="line">D: DBeaver/DataGrip/Navicat</span><br><span class="line">F: Finder</span><br><span class="line">G: RapidApi/Transmit/FileZilla</span><br><span class="line">Z: Pencil/Sketch</span><br><span class="line">X: WPS Office/Visual Studio/Safari/Parallels Desktop</span><br><span class="line">C: Chrome</span><br><span class="line">V: Visual Studio Code</span><br><span class="line">B: MarginNote 3/PDF Professional</span><br><span class="line">Y: </span><br><span class="line">U: </span><br><span class="line">I:</span><br><span class="line">O:</span><br><span class="line">P:</span><br><span class="line">H: </span><br><span class="line">J: </span><br><span class="line">K:</span><br><span class="line">L:</span><br><span class="line">N:</span><br><span class="line">M:</span><br></pre></td></tr></table></figure></p>
<h2 id="Charles-http-https-手机抓包设置"><a href="#Charles-http-https-手机抓包设置" class="headerlink" title="Charles http/https 手机抓包设置"></a>Charles http/https 手机抓包设置</h2><p>Proxy -&gt; Proxy Setting…<br>    Enable transparent HTTP proxying, Port:8888<br>    Enbale macOS proxy, Use HTTP Proxy<br>Help -&gt; SSL Proxying<br>    Install Charles Root Certificate 若证书为红色，则打开证书后选择‘始终信任’<br>    Install Charles Root Certificate on a Mobile…<br>Proxy -&gt; SSL Proxy Settings -&gt; Add <code>Host:*, Port:443</code></p>
<h2 id="网易云音乐日志文件"><a href="#网易云音乐日志文件" class="headerlink" title="网易云音乐日志文件"></a>网易云音乐日志文件</h2><p>/Users/yzw/library/Containers/com.netease.163music/Data/Documents/storage/logs/music.163.log</p>
<h2 id="Office-2016"><a href="#Office-2016" class="headerlink" title="Office 2016"></a><a href="http://www.xixisoft.cn/forum.php?mod=viewthread&amp;tid=19859&amp;extra=page%3D1&amp;page=1" target="_blank" rel="noopener">Office 2016</a></h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">vip1702@office2016.red D**m***4**</span><br></pre></td></tr></table></figure>
<h2 id="Dr-Cleaner"><a href="#Dr-Cleaner" class="headerlink" title="Dr.Cleaner"></a>Dr.Cleaner</h2><h2 id="Xcode"><a href="#Xcode" class="headerlink" title="Xcode"></a>Xcode</h2><h2 id="Parallel-Desktop"><a href="#Parallel-Desktop" class="headerlink" title="Parallel Desktop"></a>Parallel Desktop</h2><p>推荐使用共享网络，但如果虚拟机之间需要根据旧有IP互相访问(例如从VirtualBox迁移过来)，则可以自行配置一个HostOnly网络。例如：<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">起始地址：192.168.56.101</span><br><span class="line">结束地址：192.168.56.254</span><br><span class="line">子网掩码：255.255.255.0</span><br></pre></td></tr></table></figure></p>
<h2 id="SublimeText-3"><a href="#SublimeText-3" class="headerlink" title="SublimeText 3"></a>SublimeText 3</h2><ul>
<li><a href="http://www.cnblogs.com/zuike/p/4402022.html" target="_blank" rel="noopener">进入VIM模式</a></li>
<li>安装插件<br>Old<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line">* Package Control/SidebarEnhancement/GIT</span><br><span class="line">* Terminal</span><br><span class="line">&#123;</span><br><span class="line">    &quot;teminal&quot;: &quot;iTerm2-v3.sh&quot;,</span><br><span class="line">    &quot;parameters&quot;: [&quot;--open-in-tab&quot;]</span><br><span class="line">&#125;</span><br><span class="line">* Theme SoDaReloaded/Inspired Github Color Schema</span><br><span class="line">* CodeFormatter</span><br><span class="line">* HTML5/CSS3</span><br><span class="line">* JavascriptNext/Node Completions/Javascript Completions/Vuejs Complete Packages</span><br><span class="line">* SublimeCodeIntel/Emmet（已删除Emmet）</span><br><span class="line">[pyv8无法loading的解决方法](http://uedethan.com/resolve-mac-sublime-text3-because-pyv8-unable-to-load-cause-emmet-unavailable-problems/)</span><br><span class="line">* SublimeLinter/SublimeLinter-contrib-eslint</span><br><span class="line">必须先安装eslint：`sudo npm install -g eslint`</span><br><span class="line">eslint-plugin-html: `sudo npm install -g eslint-plugin-html`</span><br><span class="line">* C Improved</span><br></pre></td></tr></table></figure>
</li>
</ul>
<p>New<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">* A File Icon</span><br><span class="line">* Anaconda</span><br><span class="line">* Boxy Theme</span><br><span class="line">* CodeFormatter</span><br><span class="line">* Fix Mac Path</span><br><span class="line">* Package Control</span><br><span class="line">* Scheme</span><br><span class="line">* SublimeREPL</span><br><span class="line">* Terminal</span><br></pre></td></tr></table></figure></p>
<ul>
<li><a href="https://blog.csdn.net/afanyusong/article/details/51085258" target="_blank" rel="noopener">SublimeText3 Python开发环境设置</a><br>其中Anaconda的设置如下<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">&#123;</span><br><span class="line">    &quot;python_interpreter&quot;: &quot;/usr/local/bin/python3&quot;,</span><br><span class="line">    &quot;suppress_word_completions&quot;: true,</span><br><span class="line">    &quot;suppress_explicit_completions&quot;: true,</span><br><span class="line">    &quot;complete_parameters&quot;: true,</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
</li>
</ul>
<p>Python3的BuildSystem设置如下<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">&#123;</span><br><span class="line">    &quot;cmd&quot;: [&quot;/usr/local/bin/python3&quot;,&quot;-u&quot;,&quot;$file&quot;],</span><br><span class="line">    &quot;file_regex&quot;: &quot;^[ ]*File \&quot;(...*?)\&quot;, line ([0-9]*)&quot;,</span><br><span class="line">    &quot;selector&quot;: &quot;source.python&quot;,</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure></p>
<p>SublimeREPL的python默认是python2，所以需要新建一个python3的目录<br>位置是：Browse Package…-&gt;SublimeREPL<br>拷贝Python目录为Python3，修改Main.sublime-menu的内容，将顶层caption改为Python3，同时注意将所有<code>id</code>,<code>external_id</code>以及<code>cmd</code>的python更改为python3即可。</p>
<p><a href="https://stackoverflow.com/questions/38939557/how-to-open-the-iterm-in-the-sublime-text-3/43647381" target="_blank" rel="noopener">Terminal配置iTerm2</a></p>
<h2 id="安装node并设置使用淘宝镜像"><a href="#安装node并设置使用淘宝镜像" class="headerlink" title="安装node并设置使用淘宝镜像"></a>安装node并设置使用淘宝镜像</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">$ npm config set registry https://registry.npm.taobao.org</span><br><span class="line">$ npm info underscore （如果上面配置正确这个命令会有字符串response）</span><br></pre></td></tr></table></figure>
<h2 id="NET-Core（安装后需要重启MacOS）"><a href="#NET-Core（安装后需要重启MacOS）" class="headerlink" title=".NET Core（安装后需要重启MacOS）"></a><a href="https://www.microsoft.com/net/core#macos" target="_blank" rel="noopener">.NET Core</a>（安装后需要重启MacOS）</h2><ul>
<li><p>DotNetCore 发布<br>发布之前，必须确保 gulp 与 bower已被正确安装</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">$ sudo npm install -g bower</span><br><span class="line">$ sudo npm install -g gulp</span><br><span class="line">$ dotnet publish</span><br></pre></td></tr></table></figure>
</li>
<li><p><a href="http://www.liuchungui.com/blog/2016/05/10/mac10-dot-11sheng-ji-an-zhuang-openssl/" target="_blank" rel="noopener">更新mac的openssl</a> （推荐使用软连接的方式，需要重启）</p>
</li>
<li>建立软连接<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">$ ln -s /usr/local/Cellar/openssl/1.0.2h_1/lib/libcrypto.1.0.0.dylib /usr/local/lib/libcrypto.1.0.0.dylib</span><br><span class="line">$ ln -s /usr/local/Cellar/openssl/1.0.2h_1/lib/libssl.1.0.0.dylib /usr/local/lib/libssl.1.0.0.dylibk1</span><br></pre></td></tr></table></figure>
</li>
</ul>
<h2 id="Dash"><a href="#Dash" class="headerlink" title="Dash"></a>Dash</h2><h2 id="Java开发环境搭建"><a href="#Java开发环境搭建" class="headerlink" title="Java开发环境搭建"></a>Java开发环境搭建</h2><h3 id="Java"><a href="#Java" class="headerlink" title="Java"></a>Java</h3><ul>
<li><a href="http://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase7-521261.html" target="_blank" rel="noopener">JDK 1.7</a></li>
<li><a href="http://www.cnblogs.com/iOS-mt/p/5726380.html" target="_blank" rel="noopener">环境变量</a></li>
<li>mac下查看java信息：<code>/usr/libexec/java_home -V</code></li>
</ul>
<h3 id="Eclipse"><a href="#Eclipse" class="headerlink" title="Eclipse"></a><a href="https://www.eclipse.org/downloads/packages/eclipse-ide-java-ee-developers/mars2" target="_blank" rel="noopener">Eclipse</a></h3><h3 id="Maven"><a href="#Maven" class="headerlink" title="Maven"></a><a href="http://www.jianshu.com/p/c25fe3c53506" target="_blank" rel="noopener">Maven</a></h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">$ brew install maven</span><br><span class="line"># 查看maven安装位置</span><br><span class="line">$ brew info maven</span><br></pre></td></tr></table></figure>
<p>修改为阿里云镜像库<br>位置：/usr/local/Cellar/maven/3.5.3/libexec/conf/settings.xml<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">&lt;mirrors&gt;</span><br><span class="line">  &lt;mirror&gt;</span><br><span class="line">    &lt;id&gt;alimaven&lt;/id&gt;</span><br><span class="line">    &lt;name&gt;aliyun maven&lt;/name&gt;</span><br><span class="line">    &lt;url&gt;http://maven.aliyun.com/nexus/content/groups/public/&lt;/url&gt;</span><br><span class="line">    &lt;mirrorOf&gt;central&lt;/mirrorOf&gt;</span><br><span class="line">  &lt;/mirror&gt;</span><br><span class="line">&lt;/mirrors&gt;</span><br></pre></td></tr></table></figure></p>
<h2 id="MySQL"><a href="#MySQL" class="headerlink" title="MySQL"></a><a href="https://dev.mysql.com/downloads/mysql/" target="_blank" rel="noopener">MySQL</a></h2><ul>
<li><a href="http://blog.csdn.net/jia611/article/details/51553067" target="_blank" rel="noopener">重置mysql root密码</a></li>
<li><a href="http://blog.csdn.net/chszs/article/details/50651264" target="_blank" rel="noopener">密码过期策略</a></li>
</ul>
<h2 id="Tomcat"><a href="#Tomcat" class="headerlink" title="Tomcat"></a><a href="http://www.imooc.com/article/6453" target="_blank" rel="noopener">Tomcat</a></h2><h2 id="Navicat"><a href="#Navicat" class="headerlink" title="Navicat"></a><a href="http://blog.csdn.net/yf814359680/article/details/51276546" target="_blank" rel="noopener">Navicat</a></h2><h2 id="SmartSvn"><a href="#SmartSvn" class="headerlink" title="SmartSvn"></a><a href="https://blog.csdn.net/liuayng/article/details/70311844" target="_blank" rel="noopener">SmartSvn</a></h2><h2 id="Axure-8"><a href="#Axure-8" class="headerlink" title="Axure 8"></a><a href="https://www.cnblogs.com/exmyth/p/8560056.html" target="_blank" rel="noopener">Axure 8</a></h2><p>授权人: Koshy<br>密码:wTADPqxn3KChzJxLmUr5jTTitCgsfRkftQQ1yIG9HmK83MYSm7GPxLREGn+Ii6xY</p>
<h2 id="百度网盘不限速下载"><a href="#百度网盘不限速下载" class="headerlink" title="百度网盘不限速下载"></a><a href="https://bbs.feng.com/forum.php?mod=viewthread&amp;tid=11754059&amp;extra=&amp;page=1" target="_blank" rel="noopener">百度网盘不限速下载</a></h2><h2 id="Mac-iOS开发"><a href="#Mac-iOS开发" class="headerlink" title="Mac iOS开发"></a><a href="http://www.cnblogs.com/kenshincui/category/594479.html" target="_blank" rel="noopener">Mac iOS开发</a></h2><h2 id="hexo时无法访问github"><a href="#hexo时无法访问github" class="headerlink" title="hexo时无法访问github"></a><a href="https://blog.csdn.net/lord_y/article/details/98967139/" target="_blank" rel="noopener">hexo时无法访问github</a></h2><h2 id="Consul"><a href="#Consul" class="headerlink" title="Consul"></a><a href="https://www.cnblogs.com/niceyoo/p/14223158.html" target="_blank" rel="noopener">Consul</a></h2><h2 id="Quarkus"><a href="#Quarkus" class="headerlink" title="Quarkus"></a><a href="https://quarkus.io/get-started/" target="_blank" rel="noopener">Quarkus</a></h2><h3 id="环境"><a href="#环境" class="headerlink" title="环境"></a>环境</h3><h4 id="jdk"><a href="#jdk" class="headerlink" title="jdk"></a>jdk</h4><p><a href="https://adoptopenjdk.net/" target="_blank" rel="noopener">openjdk11</a><br><a href="https://www.graalvm.org/" target="_blank" rel="noopener">graalvm</a><br>安装native-image<br><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">$ j11g</span><br><span class="line">$ <span class="built_in">cd</span> <span class="variable">$JAVA_HOME</span>\bin</span><br><span class="line">$ ./gu install native-image</span><br></pre></td></tr></table></figure></p>
<p><a href="https://blog.csdn.net/renmengmeng520/article/details/112659017" target="_blank" rel="noopener">jdk8_jk811_switch</a><br>~/.zshrc中，设置环境变量与jdk切换别名<br><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">export</span> JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home</span><br><span class="line"><span class="built_in">export</span> JAVA_8_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home</span><br><span class="line"><span class="built_in">export</span> JAVA_11_HOME=/Library/Java/JavaVirtualMachines/jdk-11.0.2.jdk/Contents/Home</span><br><span class="line"><span class="built_in">export</span> GRAALVM_HOME=/Library/Java/JavaVirtualMachines/graalvm-ce-java11-21.1.0/Contents/Home</span><br><span class="line"></span><br><span class="line"><span class="built_in">alias</span> j8=<span class="string">'export JAVA_HOME=$JAVA_8_HOME'</span></span><br><span class="line"><span class="built_in">alias</span> j11=<span class="string">'export JAVA_HOME=$JAVA_11_HOME'</span></span><br><span class="line"><span class="built_in">alias</span> j11g=<span class="string">'export JAVA_HOME=$GRAALVM_HOME'</span></span><br></pre></td></tr></table></figure></p>
<h4 id="maven"><a href="#maven" class="headerlink" title="maven"></a>maven</h4><p><a href="https://maven.apache.org/download.cgi" target="_blank" rel="noopener">Maven</a><br><a href="https://www.cnblogs.com/Flat-White/p/14737549.html" target="_blank" rel="noopener">HowToInstall</a></p>
<h4 id="IDE"><a href="#IDE" class="headerlink" title="IDE"></a>IDE</h4><h5 id="vscode"><a href="#vscode" class="headerlink" title="vscode"></a>vscode</h5><p>install <code>quarkus</code> extension in <code>View &gt; Extensions</code></p>
<h5 id="IDEA"><a href="#IDEA" class="headerlink" title="IDEA"></a>IDEA</h5><p>install <code>quarkus tools</code> plugin in <code>Files &gt; Settings &gt; Plugins</code></p>
<h3 id="scaffold"><a href="#scaffold" class="headerlink" title="scaffold"></a>scaffold</h3><p><a href="https://code.quarkus.io/?g=cn.icmyfuture" target="_blank" rel="noopener">https://code.quarkus.io/?g=cn.icmyfuture</a></p>
<h3 id="debug"><a href="#debug" class="headerlink" title="debug"></a>debug</h3><p>IDEA debug by following <a href="http://www.kailing.pub/article/index/arcid/286.html" target="_blank" rel="noopener">this</a> or <a href="https://www.jetbrains.com/help/idea/quarkus.html#new-project" target="_blank" rel="noopener">this</a></p>
<h2 id="Docker-Desktop-for-Mac"><a href="#Docker-Desktop-for-Mac" class="headerlink" title="Docker Desktop for Mac"></a><a href="https://www.docker.com/products/docker-desktop" target="_blank" rel="noopener">Docker Desktop for Mac</a></h2><p><a href="https://blog.csdn.net/qq_29830577/article/details/115168648" target="_blank" rel="noopener">手动安装k8s</a></p>
<p>K8s<br><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">$ touch docker-images-k8s.sh</span><br><span class="line">$ vim docker-images-k8s.sh</span><br></pre></td></tr></table></figure></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br></pre></td><td class="code"><pre><span class="line">#!/bin/bash</span><br><span class="line"></span><br><span class="line">set -e</span><br><span class="line">KUBE_VERSION=v1.19.7</span><br><span class="line">KUBE_PAUSE_VERSION=3.2</span><br><span class="line">ETCD_VERSION=3.4.13-0</span><br><span class="line">COREDNS_VERSION=1.7.0</span><br><span class="line">GCR_URL=k8s.gcr.io</span><br><span class="line">ALIYUN_URL=registry.cn-hangzhou.aliyuncs.com/google_containers</span><br><span class="line"></span><br><span class="line"># get images</span><br><span class="line">images=(kube-proxy:$&#123;KUBE_VERSION&#125;</span><br><span class="line">    kube-scheduler:$&#123;KUBE_VERSION&#125;</span><br><span class="line">    kube-controller-manager:$&#123;KUBE_VERSION&#125;</span><br><span class="line">    kube-apiserver:$&#123;KUBE_VERSION&#125;</span><br><span class="line">    pause:$&#123;KUBE_PAUSE_VERSION&#125;</span><br><span class="line">    etcd:$&#123;ETCD_VERSION&#125;</span><br><span class="line">    coredns:$&#123;COREDNS_VERSION&#125;)</span><br><span class="line"></span><br><span class="line">for imageName in $&#123;images[@]&#125; ; do</span><br><span class="line">    docker pull $ALIYUN_URL/$imageName</span><br><span class="line">    docker tag $ALIYUN_URL/$imageName $GCR_URL/$imageName</span><br><span class="line">    docker rmi $ALIYUN_URL/$imageName</span><br><span class="line">done</span><br><span class="line"></span><br><span class="line"># show images</span><br><span class="line">docker images</span><br></pre></td></tr></table></figure>
<p>执行命令<br><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">$ chmod +x docker-images-k8s.sh</span><br><span class="line">$ ./docker-images-k8s.sh</span><br></pre></td></tr></table></figure></p>
<p>Dashboard<br><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">$ touch docker-images-dashboard.sh</span><br><span class="line">$ vim docker-images-dashboard.sh</span><br></pre></td></tr></table></figure></p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#!/bin/bash</span></span><br><span class="line"></span><br><span class="line"><span class="built_in">set</span> -e</span><br><span class="line">KUBE_DASHBOARD_VERSION=v2.0.3</span><br><span class="line">METRICS_SCRAPER=v1.0.4</span><br><span class="line">KUBENETESUI_URL=kubernetesui</span><br><span class="line">ALIYUN_KUBENETESUI_URL=registry.cn-hangzhou.aliyuncs.com/kubernetes_ns</span><br><span class="line"></span><br><span class="line"><span class="comment"># get images (ui)</span></span><br><span class="line">imagesui=(dashboard:<span class="variable">$&#123;KUBE_DASHBOARD_VERSION&#125;</span></span><br><span class="line">    metrics-scraper:<span class="variable">$&#123;METRICS_SCRAPER&#125;</span>)</span><br><span class="line"></span><br><span class="line"><span class="keyword">for</span> imageName <span class="keyword">in</span> <span class="variable">$&#123;imagesui[@]&#125;</span> ; <span class="keyword">do</span></span><br><span class="line">    docker pull <span class="variable">$ALIYUN_KUBENETESUI_URL</span>/<span class="variable">$imageName</span></span><br><span class="line">    docker tag <span class="variable">$ALIYUN_KUBENETESUI_URL</span>/<span class="variable">$imageName</span> <span class="variable">$KUBENETESUI_URL</span>/<span class="variable">$imageName</span></span><br><span class="line">    docker rmi <span class="variable">$ALIYUN_KUBENETESUI_URL</span>/<span class="variable">$imageName</span></span><br><span class="line"><span class="keyword">done</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># show images</span></span><br><span class="line">docker images</span><br></pre></td></tr></table></figure>
<p>执行命令<br><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">$ chmod +x docker-images-dashboard.sh</span><br><span class="line">$ ./docker-images-dashboard.sh</span><br></pre></td></tr></table></figure></p>
<p><a href="https://www.cnblogs.com/xinrong2019/p/14005905.html" target="_blank" rel="noopener">部署dashboard</a><br><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">$ kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0/aio/deploy/recommended.yaml</span><br><span class="line">$ kubectl proxy</span><br></pre></td></tr></table></figure></p>
<p><a href="http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy" target="_blank" rel="noopener">dashboard本地网址</a><br>添加k8s sa<br><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">cat &lt;&lt;EOF | kubectl apply -f -</span><br><span class="line">apiVersion: v1</span><br><span class="line">kind: ServiceAccount</span><br><span class="line">metadata:</span><br><span class="line">  name: icmyfuture</span><br><span class="line">  namespace: kubernetes-dashboard</span><br><span class="line">EOF</span><br></pre></td></tr></table></figure></p>
<p>生成token<br><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">kubectl -n kubernetes-dashboard describe secret $(kubectl -n kubernetes-dashboard get secret | grep icmyfuture | awk <span class="string">'&#123;print $1&#125;'</span>)</span><br></pre></td></tr></table></figure></p>
<p>填写token至dashboard网页输入框<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">eyJhbGciOiJSUzI1NiIsImtpZCI6Img3QWpUeHBhWURYbi1CZWU5UkdFZmxWa0VPQ1JTa3Z5NUZiOFhRSkJzYVkifQ.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJrdWJlcm5ldGVzLWRhc2hib2FyZCIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VjcmV0Lm5hbWUiOiJpY215ZnV0dXJlLXRva2VuLXNyaDd2Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9zZXJ2aWNlLWFjY291bnQubmFtZSI6ImljbXlmdXR1cmUiLCJrdWJlcm5ldGVzLmlvL3NlcnZpY2VhY2NvdW50L3NlcnZpY2UtYWNjb3VudC51aWQiOiIwMzkyMzEzNy0xOTJkLTQ2MjAtODRlMC1lN2M2ZTU4NDI2YTUiLCJzdWIiOiJzeXN0ZW06c2VydmljZWFjY291bnQ6a3ViZXJuZXRlcy1kYXNoYm9hcmQ6aWNteWZ1dHVyZSJ9.RgT2iT4B7MGbJLX2B5SAtOcblDeqnrIbzAbQI1fo5dE7w5xPtRI3Z6viNSZzrRcz6cURTIIyPRb0IGxArIiHwBNCYNxr7JsaczBq2dHE_YiiFHU_E6Mi4IUYEpztQl_sfg8k01MNNBrMovyxABEDdWu0F8uLezlyiAdENlttJuMbVjrVeEZAyiKbtlQ92C770F6qQWWZk3ddKtfWdcHCG816dCdFNPF2xXR6wnbKnTU6C0_EWKvid-vPBuxQsh7fO8hvCAcW6OVTemNgerM0BmZzXRkjFWfBtbXmUfu8cHRhnePXKR7BbqXMP_Bx8cs4hgz_Y6LQqMIvFf2-_URHgg</span><br></pre></td></tr></table></figure></p>
<h2 id="Consul-1"><a href="#Consul-1" class="headerlink" title="Consul"></a><a href="https://www.consul.io/" target="_blank" rel="noopener">Consul</a></h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">$ docker pull consul:latest</span><br><span class="line">$ docker run --name consul -d -p 8500:8500 consul</span><br></pre></td></tr></table></figure>
<p><a href="https://www.cnblogs.com/baby123/p/12710473.html" target="_blank" rel="noopener">参考</a></p>
<h2 id="Jaeger"><a href="#Jaeger" class="headerlink" title="Jaeger"></a><a href="https://www.jaegertracing.io/" target="_blank" rel="noopener">Jaeger</a></h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">$ docker pull jaegertracing/all-in-one:latest</span><br><span class="line">$ docker run -d --name jaeger -e COLLECTOR_ZIPKIN_HTTP_PORT=9411 -p 5775:5775/udp -p 6831:6831/udp -p 6832:6832/udp -p 5778:5778 -p 16686:16686 -p 14268:14268 -p 9411:9411 jaegertracing/all-in-one:latest</span><br></pre></td></tr></table></figure>
<p><a href="https://blog.csdn.net/csdn_xpw/article/details/105543488" target="_blank" rel="noopener">参考</a></p>
<h2 id="macpro2021-m1"><a href="#macpro2021-m1" class="headerlink" title="macpro2021 m1"></a>macpro2021 m1</h2><p>关闭系统更新/appstroe更新提示<br><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">defaults write com.apple.systempreferences AttentionPrefBundleIDs 0</span><br><span class="line">Killall Dock</span><br><span class="line">defaults write com.apple.appstored BadgeCount 0</span><br><span class="line">Killall Dock</span><br></pre></td></tr></table></figure></p>
<p><a href="https://www.jetbrains.com/lp/mono/" target="_blank" rel="noopener">jetbrains mono</a><br><a href="http://www.neatdownloadmanager.com/index.php/en/" target="_blank" rel="noopener">neatdownloadmanager</a><br><a href="https://blog.csdn.net/junle_carpediem/article/details/125926375" target="_blank" rel="noopener">brew</a><br><figure class="highlight md"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">export PATH=/opt/homebrew/bin:$PATH </span><br><span class="line">export PATH=/opt/homebrew/sbin:$PATH</span><br></pre></td></tr></table></figure></p>
<p><a href="https://blog.csdn.net/qq_25404477/article/details/126102189" target="_blank" rel="noopener">brew install报错</a><br><a href="https://zhuanlan.zhihu.com/p/435518571" target="_blank" rel="noopener">iterm2+ohmyzsh</a><br><figure class="highlight md"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">brew install iterm2</span><br></pre></td></tr></table></figure></p>
<p><a href="https://www.jianshu.com/p/0244fc60b921" target="_blank" rel="noopener">cloc</a><br><figure class="highlight md"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">brew install cloc</span><br></pre></td></tr></table></figure></p>
<p><a href="http://t.zoukankan.com/laoxia-p-12611478.html" target="_blank" rel="noopener">gitlab ssh</a><br><figure class="highlight md"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">git config --global user.name "due"</span><br><span class="line">git config --global user.email "ivan.e.du@yzw.cn"</span><br></pre></td></tr></table></figure></p>
<p><a href="https://zhuanlan.zhihu.com/p/487793949" target="_blank" rel="noopener">.net sdk</a><br><a href="https://dotnet.microsoft.com/zh-cn/download/dotnet/5.0" target="_blank" rel="noopener">.net 5</a><br><a href="https://blog.csdn.net/qq_43175355/article/details/126001700" target="_blank" rel="noopener">m1 .net 5</a><br><a href="http://t.zoukankan.com/dm521-p-7223066.html" target="_blank" rel="noopener">卸载.net</a><br>[jetbrains rider]<br>[jetbrains idea]<br><a href="https://www.azul.com/downloads/?package=jdk" target="_blank" rel="noopener">jdk8</a><br><a href="https://archive.apache.org/dist/maven/maven-3/3.8.1/binaries/" target="_blank" rel="noopener">maven 3.8.1</a><br><figure class="highlight md"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">JAVA_HOME=/Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home</span><br><span class="line">CLASSPATH=.:$JAVA<span class="emphasis">_HOME/lib/dt.jar:$JAVA_</span>HOME/lib/tools.jar</span><br><span class="line">export JAVA_HOME</span><br><span class="line">export CLASSPATH</span><br><span class="line">export M2_HOME=/Users/shenbowen/Downloads/apache-maven-3.6.3</span><br><span class="line">PATH=$&#123;PATH&#125;:$&#123;JAVA<span class="emphasis">_HOME&#125;/bin:$&#123;M2_</span>HOME&#125;/bin:/usr/local/share/dotnet/x64</span><br></pre></td></tr></table></figure></p>
<p><a href="https://developer.aliyun.com/article/1043958" target="_blank" rel="noopener">mat</a><br><a href="更改appid:i****@1**8密码为d**U">从appstore安装snap 无用 寻找到替代应用thor laucher</a><br>[alfred]<br>[叮叮]<br>[sublimetext]<br>[wps office]<br><a href="http://pencil.evolus.vn/" target="_blank" rel="noopener">pencil</a><br><a href="https://github.com/qier222/YesPlayMusic" target="_blank" rel="noopener">yesplaymusic</a><br>[百度网盘]<br>[微信]<br>[remotedesktop]<br>[vscode]<br>[dash]<br>[transmit]<br>[progressive downloader]<br>[go]<br>[goland]<br>[python]<br>[pycharm]<br>[docker]<br><a href="https://hexo.io/zh-cn/docs/configuration" target="_blank" rel="noopener">hexo</a><br><a href="http://home.ustc.edu.cn/~liujunyan/blog/hexo-next-theme-config/#hexo-%E9%85%8D%E7%BD%AE" target="_blank" rel="noopener">hexo主题</a><br><a href="https://studio3t.com/" target="_blank" rel="noopener">studio3t</a><br><a href="https://www.macwk.com/soft/redis-desktop-manager" target="_blank" rel="noopener">rdm</a><br>[classx]<br><figure class="highlight md"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">配置-托管配置-管理-添加：https://vpn.dovd.ml/private/vpn-collect.yaml</span><br><span class="line">Chrom插件-SwitchyOmega</span><br><span class="line"><span class="code">    情景模式-新建情景模式</span></span><br><span class="line"><span class="code">        代理服务器 - proxy- HTTP 127.0.0.1 7890</span></span><br><span class="line"><span class="code">        自动切换模式 - auto- AutoProxy https://raw.iqiq.io/gfwlist/gfwlist/master/gfwlist.txt 立刻更新情景模式</span></span><br><span class="line"><span class="code">            默认情景模式 选 直接连接</span></span><br><span class="line"><span class="code">            规则列表规则 选 proxy</span></span><br><span class="line"><span class="code">        应用选项</span></span><br><span class="line"><span class="code">    选择auto</span></span><br></pre></td></tr></table></figure></p>

      
    </div>

    <div>
      
        

      
    </div>

    <div>
      
        

      
    </div>

    <div>
      
        

      
    </div>

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/Mac/" rel="tag"># Mac</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2017/06/16/linux-note/" rel="next" title="Linux笔记">
                <i class="fa fa-chevron-left"></i> Linux笔记
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2017/06/16/win-note/" rel="prev" title="Win10笔记">
                Win10笔记 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          
  <div class="comments" id="comments">
    
  </div>


        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap" >
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
          <img class="site-author-image" itemprop="image"
               src="/uploads/avatar.jpg"
               alt="iDu" />
          <p class="site-author-name" itemprop="name">iDu</p>
           
              <p class="site-description motion-element" itemprop="description">诗酒风流品花月</p>
          
        </div>
        <nav class="site-state motion-element">

          
            <div class="site-state-item site-state-posts">
              <a href="/archives">
                <span class="site-state-item-count">23</span>
                <span class="site-state-item-name">日志</span>
              </a>
            </div>
          

          
            
            
            <div class="site-state-item site-state-categories">
              <a href="/categories/index.html">
                <span class="site-state-item-count">3</span>
                <span class="site-state-item-name">分类</span>
              </a>
            </div>
          

          
            
            
            <div class="site-state-item site-state-tags">
              <a href="/tags/index.html">
                <span class="site-state-item-count">7</span>
                <span class="site-state-item-name">标签</span>
              </a>
            </div>
          

        </nav>

        

        <div class="links-of-author motion-element">
          
            
              <span class="links-of-author-item">
                <a href="https://github.com/icmyfuture" target="_blank" title="GitHub">
                  
                    <i class="fa fa-fw fa-github"></i>
                  
                  GitHub
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="https://weibo.com/u/1865769731" target="_blank" title="Weibo">
                  
                    <i class="fa fa-fw fa-weibo"></i>
                  
                  Weibo
                </a>
              </span>
            
          
        </div>

        
        

        
        

        


      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#Mac环境"><span class="nav-number">1.</span> <span class="nav-text">Mac环境</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#设置root密码"><span class="nav-number">1.1.</span> <span class="nav-text">设置root密码</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#安装brew"><span class="nav-number">1.2.</span> <span class="nav-text">安装brew</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#设置alias"><span class="nav-number">1.3.</span> <span class="nav-text">设置alias</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#安装iTerm2-Alfred-3-Onxy"><span class="nav-number">1.4.</span> <span class="nav-text">安装iTerm2, Alfred 3, Onxy</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#VIM"><span class="nav-number">1.5.</span> <span class="nav-text">VIM</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#oh-my-zsh"><span class="nav-number">1.6.</span> <span class="nav-text">oh my zsh</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#拷贝音乐至iPod"><span class="nav-number">1.7.</span> <span class="nav-text">拷贝音乐至iPod</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#钥匙串访问"><span class="nav-number">1.8.</span> <span class="nav-text">钥匙串访问</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#iPad软件"><span class="nav-number">2.</span> <span class="nav-text">iPad软件</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#App列表"><span class="nav-number">2.1.</span> <span class="nav-text">App列表</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#Mac软件"><span class="nav-number">3.</span> <span class="nav-text">Mac软件</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#App列表-1"><span class="nav-number">3.1.</span> <span class="nav-text">App列表</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Snap-ThorLauncher-Manual"><span class="nav-number">3.2.</span> <span class="nav-text">Snap/ThorLauncher Manual</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Charles-http-https-手机抓包设置"><span class="nav-number">3.3.</span> <span class="nav-text">Charles http/https 手机抓包设置</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#网易云音乐日志文件"><span class="nav-number">3.4.</span> <span class="nav-text">网易云音乐日志文件</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Office-2016"><span class="nav-number">3.5.</span> <span class="nav-text">Office 2016</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Dr-Cleaner"><span class="nav-number">3.6.</span> <span class="nav-text">Dr.Cleaner</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Xcode"><span class="nav-number">3.7.</span> <span class="nav-text">Xcode</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Parallel-Desktop"><span class="nav-number">3.8.</span> <span class="nav-text">Parallel Desktop</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#SublimeText-3"><span class="nav-number">3.9.</span> <span class="nav-text">SublimeText 3</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#安装node并设置使用淘宝镜像"><span class="nav-number">3.10.</span> <span class="nav-text">安装node并设置使用淘宝镜像</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#NET-Core（安装后需要重启MacOS）"><span class="nav-number">3.11.</span> <span class="nav-text">.NET Core（安装后需要重启MacOS）</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Dash"><span class="nav-number">3.12.</span> <span class="nav-text">Dash</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Java开发环境搭建"><span class="nav-number">3.13.</span> <span class="nav-text">Java开发环境搭建</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#Java"><span class="nav-number">3.13.1.</span> <span class="nav-text">Java</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Eclipse"><span class="nav-number">3.13.2.</span> <span class="nav-text">Eclipse</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Maven"><span class="nav-number">3.13.3.</span> <span class="nav-text">Maven</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#MySQL"><span class="nav-number">3.14.</span> <span class="nav-text">MySQL</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Tomcat"><span class="nav-number">3.15.</span> <span class="nav-text">Tomcat</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Navicat"><span class="nav-number">3.16.</span> <span class="nav-text">Navicat</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#SmartSvn"><span class="nav-number">3.17.</span> <span class="nav-text">SmartSvn</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Axure-8"><span class="nav-number">3.18.</span> <span class="nav-text">Axure 8</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#百度网盘不限速下载"><span class="nav-number">3.19.</span> <span class="nav-text">百度网盘不限速下载</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Mac-iOS开发"><span class="nav-number">3.20.</span> <span class="nav-text">Mac iOS开发</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#hexo时无法访问github"><span class="nav-number">3.21.</span> <span class="nav-text">hexo时无法访问github</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Consul"><span class="nav-number">3.22.</span> <span class="nav-text">Consul</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Quarkus"><span class="nav-number">3.23.</span> <span class="nav-text">Quarkus</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#环境"><span class="nav-number">3.23.1.</span> <span class="nav-text">环境</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#jdk"><span class="nav-number">3.23.1.1.</span> <span class="nav-text">jdk</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#maven"><span class="nav-number">3.23.1.2.</span> <span class="nav-text">maven</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#IDE"><span class="nav-number">3.23.1.3.</span> <span class="nav-text">IDE</span></a><ol class="nav-child"><li class="nav-item nav-level-5"><a class="nav-link" href="#vscode"><span class="nav-number">3.23.1.3.1.</span> <span class="nav-text">vscode</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#IDEA"><span class="nav-number">3.23.1.3.2.</span> <span class="nav-text">IDEA</span></a></li></ol></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#scaffold"><span class="nav-number">3.23.2.</span> <span class="nav-text">scaffold</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#debug"><span class="nav-number">3.23.3.</span> <span class="nav-text">debug</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Docker-Desktop-for-Mac"><span class="nav-number">3.24.</span> <span class="nav-text">Docker Desktop for Mac</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Consul-1"><span class="nav-number">3.25.</span> <span class="nav-text">Consul</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Jaeger"><span class="nav-number">3.26.</span> <span class="nav-text">Jaeger</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#macpro2021-m1"><span class="nav-number">3.27.</span> <span class="nav-text">macpro2021 m1</span></a></li></ol></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright" >
  
  &copy; 
  <span itemprop="copyrightYear">2025</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">iDu</span>
</div>


<div class="powered-by">
  由 <a class="theme-link" href="https://hexo.io">Hexo</a> 强力驱动
</div>

<div class="theme-info">
  主题 -
  <a class="theme-link" href="https://github.com/iissnan/hexo-theme-next">
    NexT.Pisces
  </a>
</div>


        

        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  












  
  <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>

  
  <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>

  
  <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.1"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.1"></script>



  
  


  <script type="text/javascript" src="/js/src/affix.js?v=5.1.1"></script>

  <script type="text/javascript" src="/js/src/schemes/pisces.js?v=5.1.1"></script>



  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.1"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.1"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.1"></script>



  


  




	





  





  





  






  

  <script type="text/javascript">
    // Popup Window;
    var isfetched = false;
    var isXml = true;
    // Search DB path;
    var search_path = "search.xml";
    if (search_path.length === 0) {
      search_path = "search.xml";
    } else if (/json$/i.test(search_path)) {
      isXml = false;
    }
    var path = "/" + search_path;
    // monitor main search box;

    var onPopupClose = function (e) {
      $('.popup').hide();
      $('#local-search-input').val('');
      $('.search-result-list').remove();
      $('#no-result').remove();
      $(".local-search-pop-overlay").remove();
      $('body').css('overflow', '');
    }

    function proceedsearch() {
      $("body")
        .append('<div class="search-popup-overlay local-search-pop-overlay"></div>')
        .css('overflow', 'hidden');
      $('.search-popup-overlay').click(onPopupClose);
      $('.popup').toggle();
      var $localSearchInput = $('#local-search-input');
      $localSearchInput.attr("autocapitalize", "none");
      $localSearchInput.attr("autocorrect", "off");
      $localSearchInput.focus();
    }

    // search function;
    var searchFunc = function(path, search_id, content_id) {
      'use strict';

      // start loading animation
      $("body")
        .append('<div class="search-popup-overlay local-search-pop-overlay">' +
          '<div id="search-loading-icon">' +
          '<i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i>' +
          '</div>' +
          '</div>')
        .css('overflow', 'hidden');
      $("#search-loading-icon").css('margin', '20% auto 0 auto').css('text-align', 'center');

      $.ajax({
        url: path,
        dataType: isXml ? "xml" : "json",
        async: true,
        success: function(res) {
          // get the contents from search data
          isfetched = true;
          $('.popup').detach().appendTo('.header-inner');
          var datas = isXml ? $("entry", res).map(function() {
            return {
              title: $("title", this).text(),
              content: $("content",this).text(),
              url: $("url" , this).text()
            };
          }).get() : res;
          var input = document.getElementById(search_id);
          var resultContent = document.getElementById(content_id);
          var inputEventFunction = function() {
            var searchText = input.value.trim().toLowerCase();
            var keywords = searchText.split(/[\s\-]+/);
            if (keywords.length > 1) {
              keywords.push(searchText);
            }
            var resultItems = [];
            if (searchText.length > 0) {
              // perform local searching
              datas.forEach(function(data) {
                var isMatch = false;
                var hitCount = 0;
                var searchTextCount = 0;
                var title = data.title.trim();
                var titleInLowerCase = title.toLowerCase();
                var content = data.content.trim().replace(/<[^>]+>/g,"");
                var contentInLowerCase = content.toLowerCase();
                var articleUrl = decodeURIComponent(data.url);
                var indexOfTitle = [];
                var indexOfContent = [];
                // only match articles with not empty titles
                if(title != '') {
                  keywords.forEach(function(keyword) {
                    function getIndexByWord(word, text, caseSensitive) {
                      var wordLen = word.length;
                      if (wordLen === 0) {
                        return [];
                      }
                      var startPosition = 0, position = [], index = [];
                      if (!caseSensitive) {
                        text = text.toLowerCase();
                        word = word.toLowerCase();
                      }
                      while ((position = text.indexOf(word, startPosition)) > -1) {
                        index.push({position: position, word: word});
                        startPosition = position + wordLen;
                      }
                      return index;
                    }

                    indexOfTitle = indexOfTitle.concat(getIndexByWord(keyword, titleInLowerCase, false));
                    indexOfContent = indexOfContent.concat(getIndexByWord(keyword, contentInLowerCase, false));
                  });
                  if (indexOfTitle.length > 0 || indexOfContent.length > 0) {
                    isMatch = true;
                    hitCount = indexOfTitle.length + indexOfContent.length;
                  }
                }

                // show search results

                if (isMatch) {
                  // sort index by position of keyword

                  [indexOfTitle, indexOfContent].forEach(function (index) {
                    index.sort(function (itemLeft, itemRight) {
                      if (itemRight.position !== itemLeft.position) {
                        return itemRight.position - itemLeft.position;
                      } else {
                        return itemLeft.word.length - itemRight.word.length;
                      }
                    });
                  });

                  // merge hits into slices

                  function mergeIntoSlice(text, start, end, index) {
                    var item = index[index.length - 1];
                    var position = item.position;
                    var word = item.word;
                    var hits = [];
                    var searchTextCountInSlice = 0;
                    while (position + word.length <= end && index.length != 0) {
                      if (word === searchText) {
                        searchTextCountInSlice++;
                      }
                      hits.push({position: position, length: word.length});
                      var wordEnd = position + word.length;

                      // move to next position of hit

                      index.pop();
                      while (index.length != 0) {
                        item = index[index.length - 1];
                        position = item.position;
                        word = item.word;
                        if (wordEnd > position) {
                          index.pop();
                        } else {
                          break;
                        }
                      }
                    }
                    searchTextCount += searchTextCountInSlice;
                    return {
                      hits: hits,
                      start: start,
                      end: end,
                      searchTextCount: searchTextCountInSlice
                    };
                  }

                  var slicesOfTitle = [];
                  if (indexOfTitle.length != 0) {
                    slicesOfTitle.push(mergeIntoSlice(title, 0, title.length, indexOfTitle));
                  }

                  var slicesOfContent = [];
                  while (indexOfContent.length != 0) {
                    var item = indexOfContent[indexOfContent.length - 1];
                    var position = item.position;
                    var word = item.word;
                    // cut out 100 characters
                    var start = position - 20;
                    var end = position + 80;
                    if(start < 0){
                      start = 0;
                    }
                    if (end < position + word.length) {
                      end = position + word.length;
                    }
                    if(end > content.length){
                      end = content.length;
                    }
                    slicesOfContent.push(mergeIntoSlice(content, start, end, indexOfContent));
                  }

                  // sort slices in content by search text's count and hits' count

                  slicesOfContent.sort(function (sliceLeft, sliceRight) {
                    if (sliceLeft.searchTextCount !== sliceRight.searchTextCount) {
                      return sliceRight.searchTextCount - sliceLeft.searchTextCount;
                    } else if (sliceLeft.hits.length !== sliceRight.hits.length) {
                      return sliceRight.hits.length - sliceLeft.hits.length;
                    } else {
                      return sliceLeft.start - sliceRight.start;
                    }
                  });

                  // select top N slices in content

                  var upperBound = parseInt('1');
                  if (upperBound >= 0) {
                    slicesOfContent = slicesOfContent.slice(0, upperBound);
                  }

                  // highlight title and content

                  function highlightKeyword(text, slice) {
                    var result = '';
                    var prevEnd = slice.start;
                    slice.hits.forEach(function (hit) {
                      result += text.substring(prevEnd, hit.position);
                      var end = hit.position + hit.length;
                      result += '<b class="search-keyword">' + text.substring(hit.position, end) + '</b>';
                      prevEnd = end;
                    });
                    result += text.substring(prevEnd, slice.end);
                    return result;
                  }

                  var resultItem = '';

                  if (slicesOfTitle.length != 0) {
                    resultItem += "<li><a href='" + articleUrl + "' class='search-result-title'>" + highlightKeyword(title, slicesOfTitle[0]) + "</a>";
                  } else {
                    resultItem += "<li><a href='" + articleUrl + "' class='search-result-title'>" + title + "</a>";
                  }

                  slicesOfContent.forEach(function (slice) {
                    resultItem += "<a href='" + articleUrl + "'>" +
                      "<p class=\"search-result\">" + highlightKeyword(content, slice) +
                      "...</p>" + "</a>";
                  });

                  resultItem += "</li>";
                  resultItems.push({
                    item: resultItem,
                    searchTextCount: searchTextCount,
                    hitCount: hitCount,
                    id: resultItems.length
                  });
                }
              })
            };
            if (keywords.length === 1 && keywords[0] === "") {
              resultContent.innerHTML = '<div id="no-result"><i class="fa fa-search fa-5x" /></div>'
            } else if (resultItems.length === 0) {
              resultContent.innerHTML = '<div id="no-result"><i class="fa fa-frown-o fa-5x" /></div>'
            } else {
              resultItems.sort(function (resultLeft, resultRight) {
                if (resultLeft.searchTextCount !== resultRight.searchTextCount) {
                  return resultRight.searchTextCount - resultLeft.searchTextCount;
                } else if (resultLeft.hitCount !== resultRight.hitCount) {
                  return resultRight.hitCount - resultLeft.hitCount;
                } else {
                  return resultRight.id - resultLeft.id;
                }
              });
              var searchResultList = '<ul class=\"search-result-list\">';
              resultItems.forEach(function (result) {
                searchResultList += result.item;
              })
              searchResultList += "</ul>";
              resultContent.innerHTML = searchResultList;
            }
          }

          if ('auto' === 'manual') {
            input.addEventListener('input', inputEventFunction);
          } else {
            $('.search-icon').click(inputEventFunction);
            input.addEventListener('keypress', function (event) {
              if (event.keyCode === 13) {
                inputEventFunction();
              }
            });
          }

          // remove loading animation
          $(".local-search-pop-overlay").remove();
          $('body').css('overflow', '');

          proceedsearch();
        }
      });
    }

    // handle and trigger popup window;
    $('.popup-trigger').click(function(e) {
      e.stopPropagation();
      if (isfetched === false) {
        searchFunc(path, 'local-search-input', 'local-search-result');
      } else {
        proceedsearch();
      };
    });

    $('.popup-btn-close').click(onPopupClose);
    $('.popup').click(function(e){
      e.stopPropagation();
    });
    $(document).on('keyup', function (event) {
      var shouldDismissSearchPopup = event.which === 27 &&
        $('.search-popup').is(':visible');
      if (shouldDismissSearchPopup) {
        onPopupClose();
      }
    });
  </script>





  

  

  

  

  

  

</body>
</html>
